import { post } from '@/utils/axios';
import commonHandle from '@/api/commonHandle';

/** ******************************************** getSMSVerificationCode 6500 start ********************************************** */

export interface IGetSMSVerificationCodeResult {
  code: number;
  message: string;
  data: {
    time: number;

  };

}

export interface IGetSMSVerificationCodeData {
  phoneNumber: number;

}

export interface IGetSMSVerificationCodeResultCallBackOptions {
  successCb?: (res: IGetSMSVerificationCodeResult) => void;
  errorCb?: (res: IGetSMSVerificationCodeResult) => void;
  completeCb?: (res: IGetSMSVerificationCodeResult) => void;
  failCb?: (res: IGetSMSVerificationCodeResult) => void;
}

export function getSMSVerificationCode(params: IGetSMSVerificationCodeData, options?: IGetSMSVerificationCodeResultCallBackOptions): Promise<IGetSMSVerificationCodeResult> {
  const promiseRes = post<IGetSMSVerificationCodeResult>('/api/common/aaaaa', params);
  return commonHandle<IGetSMSVerificationCodeResult, IGetSMSVerificationCodeResultCallBackOptions>(promiseRes, options);
}

/** ******************************************** getSMSVerificationCode 6500 end ********************************************** */
